home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 709 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: tbj.dec.com!diamond
  2. From: diamond@tbj.dec.com (Norman Diamond)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Initializing a variable in terms of itself
  5. Date: 9 Apr 1996 02:44:43 GMT
  6. Organization: Digital Equipment Corporation Japan , Tokyo
  7. Message-ID: <4kciur$l9l@usenet.pa.dec.com>
  8. References: <4jpj9l$ik9@cnn.Princeton.EDU> <KANZE.96Apr2171323@slsvgqt.lts.sel.alcatel.de> <4k65h6$dfe@nntp.crl.com>
  9. Reply-To: diamond@tbj.dec.com (Norman Diamond)
  10. NNTP-Posting-Host: jit533.tbj.dec.com
  11.  
  12. In article <4k65h6$dfe@nntp.crl.com>, tmcd@crl.com (Timothy A. McDaniel) writes:
  13. >In article <KANZE.96Apr2171323@slsvgqt.lts.sel.alcatel.de>,
  14. >James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> wrote:
  15. >>The variable is declared, and available for use, as soon as
  16. >>the compiler sees the `=' sign.
  17.  
  18. >So     void *x = &x;
  19. >would be legal, then, and x would point to itself?
  20.  
  21. Yes.
  22.  
  23. >(Or would it have to be     void *x = (void *) &x;    ?)
  24.  
  25. There is no difference between your two versions.  Conversions either way
  26. between a pointer to object type (including a pointer to incomplete type)
  27. and a pointer to void are allowed implicitly and are identical to conversions
  28. obtained from explicit casts.
  29. --
  30.  <<  If this were the company's opinion, I would not be allowed to post it.  >>
  31. "I paid money for this car, I pay taxes for vehicle registration and a driver's
  32. license, so I can drive in any lane I want, and no innocent victim gets to call
  33. the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
  34.